package com.example.normal;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

//一个简单的界面，模拟用户输入用户名、密码，点击按钮后就跳转到SecondActivity
//只是为了演示正常的Activity而已，无实际功能
public class MainActivity extends Activity {

    Button login = null;
    EditText userName = null;
    EditText password = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        login = (Button)findViewById(R.id.LoginButton);
        userName = (EditText)findViewById(R.id.UserNameEdit);
        password = (EditText)findViewById(R.id.PasswordEdit);

        login.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(MainActivity.this, SecondActivity.class);
                //启动SecondActivity
                startActivity(intent);
            }
        });

    }
}

